package kr.hkit.powerjava.chapter07.work;

import java.util.Scanner;

public class Three {

    private int num, inputnum;

    public Three(int num) {
        super();
        this.num = num;
    }

    void game() {
        Scanner input = new Scanner(System.in);

        do {
            System.out.print("수를 입력해보시게: ");
            inputnum = input.nextInt();

            if (num > inputnum) {
                System.out.println("입력된 수가 답보다 낮다");
            }

            else if (num < inputnum) {
                System.out.println("입력된 수가 답보다 높다");
            }

            else {
                System.out.println("정답");
            }
        } while (inputnum > 0 && inputnum != num);
    }
}

